package ar.com.fiuba.ElectronicCircuitAnalyst.domain.impl;

import ar.com.fiuba.ElectronicCircuitAnalyst.domain.api.Connection;
import ar.com.fiuba.ElectronicCircuitAnalyst.domain.api.Lead;
import ar.com.fiuba.ElectronicCircuitAnalyst.domain.exceptions.LeadConnectionLimitReachedException;

public class ConnectionImpl implements Connection {
	private Lead input;
	private Lead output;

	public ConnectionImpl(Lead input, Lead output) throws LeadConnectionLimitReachedException {
		this.input = input;
		this.output = output;
		this.input.addConnection(this);
		this.output.addConnection(this);
	}

	public void connect() {
		output.setValue(input.getValue());
	}

}
